package cn.sytton.taffe.web.sys.entity;

import cn.sytton.taffe.framework.base.entity.BaseUpdatedEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * 菜单entity sys_menu
 *
 * @author skyrock
 */
@Schema(description = "菜单")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_menu")
public class MenuEntity extends BaseUpdatedEntity {

    @Schema(description = "菜单ID")
    @TableId(type = IdType.INPUT)
    private String menuId;    // 菜单ID

    @Schema(description = "菜单名称")
    private String menuName;    // 名称

    @Schema(description = "相对路径")
    private String path;    // 相对路径

    @Schema(description = "组件")
    private String component;    // 组件

    @Schema(description = "图标")
    private String iconClass;    // 图标

    @Schema(description = "显示顺序")
    private Integer seq = 0;    // 显示顺序

    @Schema(description = "父级菜单ID")
    private String parentId;    // 父级菜单ID

    @Schema(description = "是否隐藏: 隐藏1/不隐藏0")
    private Integer hidden = 0;    // 隐藏 

    //-----以下是关联属性-----

    @Schema(description = "功能项集合")
    @TableField(exist = false)
    private List<String> funcKeys = new ArrayList<>(); //功能项集合

    @Schema(description = "下级菜单集合")
    @TableField(exist = false)
    private List<MenuEntity> children = new ArrayList<>(); //下级菜单集合
}
